# setcomp.py
s1 = {1,2,3,4}
s2 = {3,4,5,6}
# 交集：运算符&或成员函数：intersection()
print("s1 & s2:",s1 & s2)
print("s1.intersection(s2)",s1.intersection(s2))

# 并集：集合运算符：|或成员函数：union（）
print("s1|s2:",s1|s2)
print("s1.union(s2)",s1.union(s2))

# 差集：集合运算符：- 或 成员函数：difference()
print("s1-s2:",s1-s2)
print("s1.difference(s2)",s1.difference(s2))

# 补集：集合运算符：上三角或成员函数：symmertric_difference()
print("s1^s2:",s1^s2)
print("s1.symmetric_difference(s2)",s1.symmetric_difference(s2))